﻿using DAO;
using DTO;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BUS
{
    public class ThietBiDienBUS
    {
/*-------------------------LOAD----------------------------------------------------
LOADTBDIEN
LOADTBDIEN_STT @STT int
LOADTBDIEN_LOAITB @LoaiTB int
LOADTBDIEN_MATHONGSO @MaThongSo int
 */

        public DataTable LOADLOAITHIETBIDIEN()
        {
            ThietBiDienDAO tbdDAO = new ThietBiDienDAO();
            return tbdDAO.LOADLOAITHIETBIDIEN();
        }

        public DataTable LOADTHIETBIDIEN()
        {
            ThietBiDienDAO tbdDAO = new ThietBiDienDAO();
            return tbdDAO.LOADTHIETBIDIEN();
        }

        public void THEMTHIETBIDIEN(ThietBiDienDTO tbdDTO)
        {
            ThietBiDienDAO tbdDAO = new ThietBiDienDAO();
            tbdDAO.THEMTHIETBIDIEN(tbdDTO);
        }

        public int SUATHIETBIDIEN(ThietBiDienDTO tbdDTO)
        {
            ThietBiDienDAO tbdDAO = new ThietBiDienDAO();
            //tbdDAO.SUATHIETBIDIEN(tbdDTO);
            return tbdDAO.SUATHIETBIDIEN(tbdDTO);
        }

        public int XOATHIETBIDIEN(int STT)
        {
            ThietBiDienDAO tbdDAO = new ThietBiDienDAO();
            //tbdDAO.XOATHIETBIDIEN(STT);
            return tbdDAO.XOATHIETBIDIEN(STT);
        }

        /************************************************/

        public DataTable LoadBoKichDien()
        {
            ThietBiDienDAO BoKD_DAO = new ThietBiDienDAO();
            return BoKD_DAO.LoadBoKichDien();
        }

        public DataTable LoadMachDieuKhien()
        {
            ThietBiDienDAO _mdk = new ThietBiDienDAO();
            return _mdk.LoadMachDieuKhien();
        }
        public DataTable LoadTBDien()
        {
            ThietBiDienDAO _tbd = new ThietBiDienDAO();
            return _tbd.LoadTBDien();
        }
        public DataTable LoadTBDien_STT(int STT)
        {
            ThietBiDienDAO _tbd = new ThietBiDienDAO();
            return _tbd.LoadTBDien(STT);
        }
        public DataTable LoadTBDien_LoaiTB(int LoaiTB)
        {
            ThietBiDienDAO _tbd = new ThietBiDienDAO();
            return _tbd.LoadTBDien(LoaiTB);
        }
        public DataTable LoadTBDien(int MaThongSo)
        {
            ThietBiDienDAO _tbd = new ThietBiDienDAO();
            return _tbd.LoadTBDien(MaThongSo);
        }

/*-------------------------INSERT----------------------------------------------------
THEMTBDIEN
	@Vol decimal,
	@Amp decimal,
	@CSHaoHut int,
	@HSDeBa int,
	@GhiChu nvarchar(50),
	@MaThongSo int,
	@LoaiTB int
 */
//THEMBOKICHDIEN

        public void ThemThietBiDien(ThietBiDienDTO tbd)
        {
            ThietBiDienDAO _tbd = new ThietBiDienDAO();
            _tbd.ThemThietBiDien(tbd);
        }

        public void THEMMACHSAC(ThietBiDienDTO tbd)
        {
            ThietBiDienDAO _tbd = new ThietBiDienDAO();
            _tbd.THEMMACHSAC(tbd);
        }

        public void THEMBOKICHDIEN(ThietBiDienDTO tbd)
        {
            ThietBiDienDAO _tbd = new ThietBiDienDAO();
            _tbd.THEMBOKICHDIEN(tbd);
        }
/*-------------------------UPDATE----------------------------------------------------
SUATBDIEN @STT int,
	@Vol decimal,
	@Amp decimal,
	@CSHaoHut int,
	@HSDeBa int,
	@GhiChu nvarchar(50),
	@LoaiTB int
 */
        //Chỉnh sửa thông số của thiết bị điện
        public int SuaThietBiDien(ThietBiDienDTO tbd)
        {
            ThietBiDienDAO _tbd = new ThietBiDienDAO();
            return _tbd.SuaThietBiDien(tbd);
        }



/*-------------------------DELETE----------------------------------------------------
XOATBDIEN @STT int         
*/
        public int XoaThietBiDien(int STT)
        {
            ThietBiDienDAO _tbd = new ThietBiDienDAO();
            return _tbd.XOATHIETBIDIEN(STT);
        }
    }
}
